<template>
  <div class="adopt">
    <navbar></navbar>
    <!-- 主体内容 -->
     <div class="main">
       <!-- banner -->
         <div class="block">
              <img src="../../assets/p_banner.jpg" alt="">
        </div>

  <!-- 领养展示 -->
    <div class="content">
      <div class="foster">
            <p>—————————————————————————— 宠物领养 ——————————————————————————</p>
          <p>ADOPT</p>
        </div>  
    <!-- 宠物分类 -->
        <div class="list">
          <ul> 
            <a v-for="(relation,index) in relations" :key="index" :id="relation.id"  :class="{checked:index==nowIndex}" @click="relationClick(index)"> 
              <i></i> 
              <span>{{relation.text}}</span> 
            </a> 
          </ul>
        </div>
        
          <!-- 宠物详情 -->
          <div>
              <div class="all" v-for="(item,index) in 2" :key="index">
                <img src="../../assets/news/n_dog.jpg" alt="">
                <ul>
                    <h1>北京六个月大聪明乖巧狗狗免费赠养，只求善待</h1>
                    <li>
                      <img src="http://www.petly.net/uc_server/avatar.php?uid=75347&size=middle" alt="">
                      <p>空空如也</p>
                      <span class="iconfont">2019-07-2</span>
                    </li>
                    <p>
              狗狗2个月左右的时候从街上捡到的，现在6-7个月左右大，由于工作原因要离开北京了，所以想找个爱它的主人好好养它！狗狗非常亲人，听话，聪明，很多
              ...</p>
              <el-button
              class="btn"
                    type="small"
                    round
                  >查看详情
                  </el-button>
                </ul>
                
              </div> 
          </div>
          <!-- 我要寄养 -->
          <div class="foster">
            <p>—————————————————————————— 宠物寄养 ——————————————————————————</p>
            <p>FOSTER</p>
          </div>
          <!-- 流程 -->
          <div class="suggest">
            <img src="../../assets/intro.jpg" alt="">
            <li>
              <h1>寄养流程介绍</h1>
              <p>安全可靠放心舒服安逸</p>
            </li>
          </div>
      </div>
     </div>
  </div>
</template>

<script>
import navbar from '../../components/navbar'
export default {
  name:"adopt",
  data(){
      return{
        relations: [ 
          {text:'猫猫',id:'program'}, 
          {text:'猫猫',id:'person'}, 
          {text:'猫猫',id:'organization'}, 
          {text:'大象',id:'tech'}, 
          {text:'猪猪',id:'location'}, 
          {text:'猫猫',id:'country'} 
        ],
        nowIndex: 0,
      }
  },
  methods:{
    newBack() {
      console.log("最新回复");
    },
     relationClick:function(index){ 
        this.nowIndex=index; 
        } 
  },
  components:{
    navbar
  }
}
</script>

<style lang="less" scoped>
.main{
    width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    /* background-color: #f6f6f6; */
 
    .block{
          width: 100%;
          img{
            width: 100%;
            height: 220px;
            margin: 0;
          }
     }
  .content{
      width: 90%;
      margin: 0 auto;
     .list{
       display: flex;
       width: 90%;
       margin: 0 auto;
       height: 70px;
       align-items: center;
       background-color: #ccc;
       border-radius: 30px;
       ul{
         display: flex;
         width: 100%;
         justify-content: space-around;
         margin: 0px 20%;
         a{
           width: 80px;
           height: 40px;
           line-height: 40px;
           text-align: center;
           background-color: #fff; 
           border-radius: 20px;
         }
         span{
            cursor:pointer;
            font-size: 16px;
            color: #7abefd;
            user-select:none;
         }
       }
        .active{ 
          background-color: #000; 
          } 
          .checked{ 
            background: #ccc; 
          }
     }
     .all{
      width: 70%;
      margin: 20px auto;
      padding:30px;
      display: flex;
      border: 1px dashed #7abefd;
      border-radius: 15px;
    >img{
      width: 200px;
      height: 120px;
      border-radius: 10px;
    }
    ul{
      text-align: left;
      margin-left: 20px;
      h1{
        font-size: 18px;
        margin: 0;
        text-align: center;
      }
      li{
        margin-top: 20px;
        display: flex;
        align-items: center;
        img{
        width: 30px;
        height: 30px;
        border-radius: 50%;
      }
      p{
        width: 30%;
        font-size: 12px;
        color: #7a7a7a;
        margin-left: 10px;
      }
      span{
        display: flex;
        align-items: center;
        font-size: 12px;
        color: #7a7a7a;
      }
      span::before{
        content: "\e74f";
        width: 20px;
        height: 20px;
        line-height: 20px;
        
      }
    }
      >p{
        margin-top: 10px;
        font-size: 14px;
        color: #7a7a7a;
      }
      
    }
    .btn{
      background-color: #7abefd;
      color: #fff;
      float: right;
    }
  }
  .foster{
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 20px 0px;
    text-align: center;
    p{
      width: 100%;
      color: #7abefd;
    }
  }
    }
}
.suggest{
  display: flex;
  justify-content: space-around;
  height: 300px;
  img{
    width: 300px;
    height: 250px;
    background-size: 100%;
  }
  li{
    display: flex;
    flex-wrap: wrap;
    margin-left: 30px;
    h1{
      width: 100%;
      font-size: 18px;
      color: #7abefd;
    }
    p{
       margin: 0;
    }
  }
}
</style>